<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=640px, user-scalable=no">
    <meta name="apple-themes-web-app-capable" content="yes">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <meta content="email=no" name="format-detection">
    <meta name="format-detection" content="telephone=no">
    <title>培优广场</title>
    <link rel="stylesheet" href="/static/index/css/main.css" type="text/css" media="all">
    <style type="text/css">
        .imgDiv img {
            width: 100%;
            height: 100%;
        }
        .imgUl li{
            height: 90px;
        }

        .imgUl img {
            width: 100%;
            height: 100%;
        }
        .img{
            width: 100%;
            height: 100%;
        }
    </style>
</head>

<body>
<!--页面加载 开始-->
<div id="preloader">
    <div id="status">
        <p class="center-text"><span>拼命加载中···</span></p>
    </div>
</div>
<!--页面加载 结束-->

<div id="content_div">
    <!--首页轮播-->
    <div class="top_pic">
        <div class="carousel-image" id="scroll_img">
            <div class="imgDiv">
                {volist name="carouselList" id="vo"}
                <a href="{$vo['rec_url']}"><img src="{$vo['rec_image']}" class="img"/></a>
                {/volist}
            </div>
            <span class="carousel-num"></span>
        </div>
        <a href="{:url('index/index/chooseLocation')}" class="weizhi" id="city">{$cty_name}</a>
        <!--<a href="search.html" class="search">输入关键字</a>-->
    </div>






    <div class="home_mian_down">
        <p style="float: left;">目前平台有 <span>{$institutionNum}</span> 家机构</p>
        <p style="float: right; margin-right: 20px;">平台文章 <span>{$articleNum}</span> 篇</p>
    </div>

    <div class="mian">
        <div class="title">
            <div class="main_bt bgcolor1">
                平台推荐
            </div>
        </div>
        <div class="bianmin_li pt20">
            <ul class="imgUl">
                {volist name="recommendList" id="vo"}
                <li>
                    <a href="{$vo['rec_url']}"><img src="{$vo['rec_image']}"/></a>
                </li>
                {/volist}

            </ul>
        </div>
    </div>

    <div class="mian">
        <div class="title">
            <div class="main_bt bgcolor2">
                好课列表
            </div>
            <a href="{:url('index/Article/goodClassList')}" class="more">更多</a>
        </div>
        <div class="bianmin pt20">
            <ul>
                {volist name="goodClassList" id="vo"}
                <li>
                    <div class="img">
                        <a href="{$vo['art_url']}"><img src="{$vo['art_thumb']}"/></a>
                    </div>
                    <div class="text">
                        <p style="font-weight: bolder;"><a href="{$vo['art_url']}">课程名称：{$vo['art_title']}</a></p>
                        <p>所属机构：{$vo['bind_institution']['ins_name']}</p>
                        <p>所属类别：{$vo['bind_category']['acc_name']}</p>
                        <p class="ptime">{$vo['art_create_time']}</p>
                    </div>
                </li>
                {/volist}
            </ul>
        </div>
    </div>


    <div class="mian">
        <div class="title">
            <div class="main_bt bgcolor5">
                好文精选
            </div>
            <a href="{:url('index/Article/goodArticleList')}" class="more">更多</a>
        </div>
        <div class="main_news_li2 p20">
            <ul>
                {volist name="goodArticleList" id="vo"}
                <li>
                    <p style="width: 450px"><a href="{$vo['art_url']}">{$vo['art_title']}</a></p><span
                        style="width: 150px">{$vo['art_create_time']}</span>
                </li>
                {/volist}
            </ul>
        </div>
    </div>
</div>

<!--底部-->
<div class="foot_nav">
    <ul>
        <li>
            <a href="/" class="active">
                <img src="/static/index/images/nav1-active.png"/>
                <p>首页</p>
            </a>
        </li>
        <li>
            <a href="{:url('index/Institution/institutionList')}">
                <img src="/static/index/images/nav2.png"/>
                <p>培优</p>
            </a>
        </li>

        <li>
            <a href="{:url('index/Article/goodClassList')}">
                <img src="/static/index/images/nav3.png" style="width: 45px;height: 42px;margin-top: -6px;"/>
                <p>好课</p>
            </a>
        </li>
        <li>
            <a href="{:url('index/Article/goodArticleList')}">
                <img src="/static/index/images/nav4.png"/>
                <p>好文</p>
            </a>
        </li>
        <li>
            <a href="http://wechat.wx.0579bb.com/app/index.php?i=7&c=entry&do=forum&m=meepo_bbs">
                <img src="/static/index/images/nav5.png"/>
                <p>BBS</p>
            </a>
        </li>
    </ul>
</div>


<!--底部结束-->
<script type="text/javascript" src="/static/index/js/zepto.js"></script>
<script type="text/javascript" src="/static/index/js/carousel-image.js"></script>
<script>
    $('.carousel-image').CarouselImage({
        num: $('.carousel-image .carousel-num'),
        repeat: true
    });
</script>
<script type="text/javascript" src="/static/index/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/index/js/common.js"></script>
<script type="text/javascript">
    $(function () {
        //未选择地址时，跳转到地址选择页面上
        var cityId = localStorage.getItem("cityId");


        var cty_name="{$cty_name}";
        //当url中未包含城市信息时，读取localStorage中的城市数据，发起请求，获取城市数据，加载到页面上
        if(cty_name=="暂未选择"){
            if(cityId){
                getCityInfo(cityId);
            }
        }
    })

    function getCityInfo(cityId) {
        $.ajax({
            url: "{:url('index/Index/getCityInfo')}",
            data: {
                cityId: cityId
            },
            type: "post",
            dataType: "json",
            success: function (res) {
                var cty_name=res.data.cty_name;
                console.log(cty_name);
                $("#city").text(cty_name);
            }
        })
    }
</script>
</body>
</html>
